package com.zhijian.medical.controller;

import com.zhijian.medical.annotation.Response;
import com.zhijian.medical.entity.vo.request.ExperimentProcessSampleReadySaveOrUpdateVo;
import com.zhijian.medical.entity.vo.response.ExperimentProcessSampleReadyVo;
import com.zhijian.medical.service.ExperimentProcessSampleReadyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 实验流程-样本准确区详情 控制层
 *
 * @author HCG
 * @version 1.0
 * @date 2022-04-17 17:33:53
 */
@Slf4j
@Controller
@Api(tags = "实验流程-样本准确区详情")
public class ExperimentProcessSampleReadyController {

    @Autowired
    private ExperimentProcessSampleReadyService service;

    /**
     * 新增
     *
     * @param param
     * @return
     */
    @Response
    @PostMapping("/experiment/process/sample/ready")
    @ApiOperation("新增or修改")
    public boolean insert(@RequestBody ExperimentProcessSampleReadySaveOrUpdateVo param) {
        log.info("{} - {}| insert info", this.getClass().getSimpleName(), param);
        return service.insert(param) != null;
    }

    /**
     * 根据id查询
     *
     * @param experimentProcessId
     * @return
     */
    @Response
    @GetMapping("/experiment/process/sample/ready/{experimentProcessId}")
    @ApiOperation("根据实验流程id查询")
    public ExperimentProcessSampleReadyVo selectById(@PathVariable("experimentProcessId") Long experimentProcessId) {
        return service.selectVoByExperimentProcessId(experimentProcessId);
    }


}